import {
	request,
} from '@/api/request';
const apiList = [
	// /api/index/getGoods
	{
		name: 'getGoods',
		url: '/api/index/getGoods',
		method:'GET'
	},
	{
		// /api/index/readConfig
		name: 'readConfig',
		url: '/api/index/readConfig',
		method:'GET'
	},
	// /api/index/getGoodsInfo?id=1
	{
		name: 'getGoodsInfo',
		url: '/api/index/getGoodsInfo',
		method:'GET'
	},
	{
		// /api/index/getCardInfo
		name: 'getCardInfo',
		url: '/api/index/getCardInfo',
		method:'GET'
	},
	{
		// /api/index/buyCard
		name: 'buyCard',
		url: '/api/index/buyCard',
	},
	{
		// /api/index/getCard
		name: 'getCard',
		url: '/api/index/getCard',
		method:'GET'
	},
	{
		// /api/index/acceptCard
		name: 'acceptCard',
		url: '/api/index/acceptCard',
	},
	{
		// /api/index/cardInfoDetail
		name: 'cardInfoDetail',
		url: '/api/index/cardInfoDetail',
		method:'GET'
	},
	{
		name: 'getCardStatusCount',
		url: '/api/index/getCardStatusCount',
		method:'GET'
	},
	{
		// /api/index/addValid
		name: 'addValid',
		url: '/api/index/addValid',
	},
	{
		// https://mm.fuliaoxx.com/api/index/getEms
		name: 'getEms',
		url: '/api/index/getEms',
		method:'GET'
	}
]

module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data) => request({
		url: params.url,
		method: params.method || 'POST',
		data
	})
	return mode
}, {})